﻿//    TestGenerator - experiment with piping data into ffmpeg in "pipefmt"
//    Copyright (C) 2012  Juergen Bohl

//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.

//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.

//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

namespace TestGenerator
{
    #region using directives
    using System.Collections.Generic;
    using System.Linq;
    #endregion

    /// <summary>
    /// Options for initializing the movie writer.
    /// </summary>
    internal class FfmpegDriverInitOptions
    {
        public IEnumerable<VideoFormat> VideoStreams { get; private set; }

        public IEnumerable<AudioFormat> AudioStreams { get; private set; }

        /// <summary>
        /// Gets or sets the name of the file.
        /// </summary>
        /// <value>The name of the file.</value>
        public string FileName { get; private set; }

        /// <summary>
        /// Gets or sets a value indicating whether we shall try to overwrite an existing file.
        /// </summary>
        /// <value>
        /// <c>True</c> if we shall try to overwrite an existing file; otherwise, <c>false</c>.
        /// </value>
        public bool OverwriteExistingFile { get; private set; }

        public FfmpegDriverInitOptions(VideoFormat videoStream, AudioFormat audioStream, string fileName)
            : this(videoStream, audioStream, fileName, false)
        {
        }

        public FfmpegDriverInitOptions(VideoFormat videoStream, AudioFormat audioStream, string fileName, bool overWrite)
            : this(videoStream != null ? Enumerable.Repeat(videoStream, 1) : null, audioStream != null ? Enumerable.Repeat(audioStream, 1) : null, fileName, overWrite)
        {
        }

        public FfmpegDriverInitOptions(IEnumerable<VideoFormat> videoStreams, IEnumerable<AudioFormat> audioStreams, string fileName)
            : this(videoStreams, audioStreams, fileName, false)
        {
        }

        public FfmpegDriverInitOptions(IEnumerable<VideoFormat> videoStreams, IEnumerable<AudioFormat> audioStreams, string fileName, bool overWrite)
        {
            this.VideoStreams = videoStreams;
            this.AudioStreams = audioStreams;
            this.FileName = fileName;
            this.OverwriteExistingFile = overWrite;
        }
    }
}
